//Source file: D:\\test\\com\\ce\\pms\\house\\model\\AreaDomain.java

package com.ce.pms.house.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.ce.pms.common.model.SysInfo;
import com.sitechasia.webx.core.model.IDomainObject;

/**
 * 实体:楼盘 关联表：HM_AREA
 */
@Entity
@Table(name = "HM_AREA")
public class AreaDomain implements IDomainObject {

	/**
	 * 楼盘主键
	 */
	@Id
	@GeneratedValue
	@Column(name = "AREA_ID")
	private Long keyword;

	/**
	 * 楼盘名称
	 */
	@Column(name = "NAME", nullable = false, length = 50)
	private String name;

	/**
	 * 楼盘地址
	 */
	@Column(name = "ADDRESS", nullable = false, length = 200)
	private String address;

	/**
	 * 是否分期: 1是 0否
	 */
	@Column(name = "HAS_MORE_PROJECT", length = 1)
	private String hasMoreProject;

	/**
	 * 配套设施 检索策略:lazy=false 级联配置:cascade=all-delete-orphan
	 */
	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumn(name = "LAYOUT_ID")
	private Layout layout;

	/**
	 * 交通位置图 检索策略:lazy=false
	 */
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TRAFFIC_IMAGE_ID")
	private ImageDomain trafficImage;

	/**
	 * 派出所 检索策略:lazy=false
	 */
	@OneToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "POLICE_STATION_ID")
	private CoWorkerDomain policeStation;

	/**
	 * 街道办 检索策略:lazy=false
	 */
	@OneToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "STREET_ORG_ID")
	private CoWorkerDomain streetOrg;

	/**
	 * 居委会 检索策略:lazy=false
	 */
	@OneToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "BOTTOM_ORG_ID")
	private CoWorkerDomain bottomOrg;

	@OneToMany(mappedBy = "area")
	private Set<BuildingDomain> buildings = new HashSet<BuildingDomain>();
	/**
	 * 期数
	 */
	@OneToMany(mappedBy = "area")
	private Set<ProjectDomain> projects = new HashSet<ProjectDomain>();

	@Embedded
	private SysInfo sysInfo;

	/**
	 * @roseuid 484F3FA70138
	 */
	public AreaDomain() {

	}

	/**
	 * mini constructor
	 *
	 * @param name
	 *            楼盘名称
	 * @param address
	 *            楼盘地址
	 * @param sysInfo
	 *            系统信息
	 */
	public AreaDomain(String name, String address, SysInfo sysInfo) {
		super();
		this.name = name;
		this.address = address;
		this.sysInfo = sysInfo;
	}

	/**
	 * 算法描述: 1. 验证页面不可空字段.
	 *
	 * @param area
	 * @roseuid 48465C600232
	 */
	public void checkFields(AreaDomain area) {

	}

	/***************************************************************************
	 * Accessors and Modifiers
	 **************************************************************************/

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Long getKeyword() {
		return keyword;
	}

	public void setKeyword(Long keyword) {
		this.keyword = keyword;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public SysInfo getSysInfo() {
		return sysInfo;
	}

	public void setSysInfo(SysInfo sysInfo) {
		this.sysInfo = sysInfo;
	}

	public Set<BuildingDomain> getBuildings() {
		return buildings;
	}

	public void setBuildings(Set<BuildingDomain> buildings) {
		this.buildings = buildings;
	}

	public CoWorkerDomain getBottomOrg() {
		return bottomOrg;
	}

	public void setBottomOrg(CoWorkerDomain bottomOrg) {
		this.bottomOrg = bottomOrg;
	}

	public String getHasMoreProject() {
		return hasMoreProject;
	}

	public void setHasMoreProject(String hasMoreProject) {
		this.hasMoreProject = hasMoreProject;
	}

	public Layout getLayout() {
		return layout;
	}

	public void setLayout(Layout layout) {
		this.layout = layout;
	}

	public CoWorkerDomain getPoliceStation() {
		return policeStation;
	}

	public void setPoliceStation(CoWorkerDomain policeStation) {
		this.policeStation = policeStation;
	}

	public CoWorkerDomain getStreetOrg() {
		return streetOrg;
	}

	public void setStreetOrg(CoWorkerDomain streetOrg) {
		this.streetOrg = streetOrg;
	}

	public ImageDomain getTrafficImage() {
		return trafficImage;
	}

	public void setTrafficImage(ImageDomain trafficImage) {
		this.trafficImage = trafficImage;
	}

	public Set<ProjectDomain> getProjects() {
		return projects;
	}

	public void setProjects(Set<ProjectDomain> projects) {
		this.projects = projects;
	}

}
